<?php
namespace app\common\model;

use think\Model;
use think\Db;

class Collection extends Model
{
    public function getCollectionlist($id){
        $result = Db::name('collection')->where('uid',$id)->group('type')->column('type,GROUP_CONCAT(collectionid)');
        foreach($result as $k=>$v){
            $v = explode(',',$v);
            $result[$k] = array_flip($v);
        }
        return $result;
    }
}